package org.javaboy;

import java.util.Arrays;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Demo06 {
    public static void main(String[] args) {
        IntStream stream = IntStream.of(1, 2, 3, 45, 6);
        stream.map(i -> i * 2).filter(i -> i < 3).forEach(a -> System.out.println(a + ">>>"));
//        System.out.println(sum);

        Stream<Integer[]> s1 = Stream.of(new Integer[]{1, 2, 3}, new Integer[]{4, 5, 6});
//        s1.map(i -> i[0]).forEach(System.out::println);
        Stream<Integer> s2 = s1.flatMap(i -> Arrays.stream(i));
        s2.forEach(System.out::println);
    }
}
